/***
//初始化一级栏目标题
function initLevelOne() {
	var levelOneHtmlStr = "";
	for ( var i = 0; i < arrLevelOne.length; i++) {
		if(i > 0){
			levelOneHtmlStr += " <span class=\"bai\" style=\"font-weight:bold;width:"+parseInt(100/arrLevelOne.length)+"% \"> | </span> ";			
		}
		levelOneHtmlStr += "<a href=\"/card/" + arrLevelOne[i][1] + "\" class=\"dh\">"
				+ arrLevelOne[i][0] + "</a>";		
	}	
	
	levelOneHtmlStr=levelOneHtmlStr.replace("index.jsp", "firstEnter.action").replace("用卡知识", "卡知识");
	//替换"相关下载"链接
	levelOneHtmlStr=replaceLink(levelOneHtmlStr,'相关下载','listf_Resources.action');
	document.write(levelOneHtmlStr);
	alert(levelOneHtmlStr);
}
***/
//初始化一级栏目标题
function initLevelOne() {
	var levelOneHtmlStr = "<table border=0 cellpadding=0 cellspacing=0 width=903 ><tr>";
	for ( var i = 0; i < arrLevelOne.length; i++) {
		
		levelOneHtmlStr += "<td align=center width="+parseInt(100/arrLevelOne.length)+"%  ><a href=\"/card/" + arrLevelOne[i][1] + "\" class=\"dh\">"
				+ arrLevelOne[i][0] + "</a></td>";		
	}	
	levelOneHtmlStr=levelOneHtmlStr+"</tr></table>";
	levelOneHtmlStr=levelOneHtmlStr.replace("index.jsp", "firstEnter.action").replace("用卡知识", "卡知识");
	//替换"相关下载"链接
	levelOneHtmlStr=replaceLink(levelOneHtmlStr,'相关下载','listf_Resources.action');
	document.write(levelOneHtmlStr);
	//alert(levelOneHtmlStr);
}



//初始化二级栏目标题
function initLevelTwo() {
	var levelTwoHtmlStr = "";
	for ( var i = 0; i < arrLevelTwo.length; i++) {		
		levelTwoHtmlStr += " <table width='85%' border='0' align='center' cellpadding='0' cellspacing='0'>";
		levelTwoHtmlStr += "<tr>";	
		levelTwoHtmlStr += "<td width='13%' height='27' align='center'><img src='/card/images/doc_more.gif' width='9' height='9' /></td>";
		//查看留言
		if(arrLevelTwo[i][0]=="查看留言"){
			arrLevelTwo[i][1]="list_lv.action";
		}
		levelTwoHtmlStr += "<td width='87%' align='left'><a href='/card/"+arrLevelTwo[i][1]+"' class='heic'>"+arrLevelTwo[i][0]+"</a></td>";			
		levelTwoHtmlStr += "</tr>";
		levelTwoHtmlStr += "<tr>";
		levelTwoHtmlStr += "<td colspan='2'><img name='in_r14_c2' src='/card/images/x.jpg' width='206' height='2' border='0' id='in_r14_c2' alt='' /></td>";
		levelTwoHtmlStr += "</tr>";
		levelTwoHtmlStr += "</table>";
	}
	//alert(levelTwoHtmlStr);
	document.write(levelTwoHtmlStr);
}
//add by changpf 
/**
 * 替换一级菜单第n个链接为指定webpage页面。
 */
function replaceLink(str,txt,webpage){
	strs=str.split("td");
	
	str="";
	var length=strs.length;
	for(i=0;i<length-1;i++){
		if(strs[i].indexOf(txt)>0){
			strs[i]=strs[i].replace('#',webpage);
		}
		str=str+strs[i]+"td";
	}
	str=str+strs[length-1];
	return str;
}
